package com.simon.app.october.modules.sys.controllers;

import com.simon.app.october.modules.sys.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;

public abstract class AbstractController {

    /**
     * 获取登录用户信息
     * */
    public SysUserEntity getUser() {
        return (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    /**
     * 获取登录用户的id
     * */
    public Long getUserId() {
        return getUser().getUserId();
    }
}
